package fr.xgouchet.wedding.client.event;

import com.google.gwt.event.shared.GwtEvent;

/**
 * Fired when the user wants to edit a task
 * 
 * @author x.gouchet
 * 
 */
public class EditTaskEvent extends GwtEvent<EditTaskEventHandler> {

	/** The Type of GwtEvent */
	public static Type<EditTaskEventHandler> TYPE = new Type<EditTaskEventHandler>();

	/**
	 * Constructor
	 * 
	 * @param id
	 *            the id of the task to edit
	 */
	public EditTaskEvent(String id) {
		mID = id;
	}

	/**
	 * @see GwtEvent#getAssociatedType()
	 */
	public Type<EditTaskEventHandler> getAssociatedType() {
		return TYPE;
	}

	/**
	 * @see GwtEvent
	 */
	protected void dispatch(EditTaskEventHandler handler) {
		handler.onEditTask(this);
	}

	/**
	 * @return the iD
	 */
	public String getID() {
		return mID;
	}

	/** the id of the task to edit */
	private String mID;
}
